package BSQX_Bit;

import java.util.Scanner;

public class BSQX_3_31 {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n= scanner.nextInt();
        for (int i = n/2; i >= 1; i--) {
            if (prime(i)){
                if (prime(n-i)){
                    if (i > n-i){
                        System.out.println(n-i);
                        System.out.println(i);
                    }else {
                        System.out.println(i);
                        System.out.println(n-i);
                    }
                    break;
                }
            }
        }
    }
    public static boolean prime(int a){
        for (int i = 2; i < a/2; i++) {
            if (a % i == 0){
                return false;
            }
        }
        return  true;
    }
    public int binInsert(int n, int m, int j, int i) {

        for (int k = 0; k < j; k++) {
            m=m<<1;
        }
        return n+m;
    }
}
